#!/bin/bash
cd /home/oracle/backup
filedmp="interlib`date +%d`.dmp"
filelog="interlib`date +%d`.log"
fileadddmp="interlib_add`date +%m`.dmp"
fileaddlog="interlib_add`date +%m`.log"
if [ -f $filedmp ];then
rm -rf $filedmp &&  rm -rf $filelog
su - oracle -c "exp interlib/cslginterlib@10.255.18.9:1521/interlib  file=/home/oracle/backup/interlib`date +%d`.dmp log=/home/oracle/backup/interlib`date +%d`.log full=y"
#su - oracle -c "exp interlib/cslginterlib@10.255.18.9:1521/interlib  file=/home/oracle/backup/interlib_add`date +%m`.dmp log=/home/oracle/backup/interlib_add`date +%m`.log full=y inctype=cumulative"
else
su - oracle -c "exp interlib/cslginterlib@10.255.18.9:1521/interlib  file=/home/oracle/backup/interlib`date +%d`.dmp log=/home/oracle/backup/interlib`date +%d`.log full=y"
#su - oracle -c "exp interlib/cslginterlib@10.255.18.9:1521/interlib  file=/home/oracle/backup/interlib_add`date +%m`.dmp log=/home/oracle/backup/interlib_add`date +%m`.log full=y inctype=cumulative"
fi
#find /home/oracle/backup/ -mtime +60 -name "*.log" -exec rm -rf {} \;
#find /home/oracle/backup/ -mtime +60 -name "*.dmp" -exec rm -rf {} \;
exit 0
